package lab02.test28;

import java.util.Scanner;

/**
 * Created by Adminitrator on 2017/11/9.
 */
public class Test {
    public static void main(String[] args) {
        //double类型的圆的半径，计算并输出其面积
        double r;
        Scanner scanner=new Scanner(System.in);
        try {
            r=Double.parseDouble(scanner.next());
            if (r<0)throw new NegativeArraySizeException();
            else {
                System.out.println("面积为："+r*r*3.14);
            }
        }catch (NumberFormatException e){
            System.out.println("数字类型异常");
        }catch (NegativeArraySizeException e){
            System.out.println("数字范围异常");
        }
    }
}
